import request from "../utils/request";

//查询所有角色
export function findAll(pageNum, pageSize, data) {
  return request({
    url: "/rbacRole/" + pageNum + "/" + pageSize,
    method: "post",
    data
  });
}

export function updateRoleStatus(param) {
  return request({
    url: "/rbacRole/" + param.id + "/" + param.status,
    method: "put"
  });
}

export function updateOne(data) {
  return request({
    url: "/rbacRole/",
    method: "put",
    data
  });
}

export function addOne(data) {
  return request({
    url: "/rbacRole/",
    method: "post",
    data
  });
}

export function findCheckedID(id) {
  return request({
    url: "/rbacRole/findCheckedID/" + id,
    method: "get"
  });
}

export function removeMenuByRoleID(roleID, menuID) {
  return request({
    url: "/rbacRole/" + roleID + "/" + menuID,
    method: "delete"
  });
}

export function addMenuByRoleID(roleID, menuID) {
  return request({
    url: "/rbacRole/addMenuByRoleID/" + roleID + "/" + menuID,
    method: "post"
  });
}


export function RoleMenuSave(roleID, data) {
  return request({
    url: "/rbacRole/roleMenuSave/" + roleID,
    method: "post",
    data
  });
}
